package com.v2.k13;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class User {

	//1.
//	@Value("匡振曦111")
//	public String userName;

	//2. SpEL表达式
	@Value("#{kzx1.userName}")
	public String userName;

//	public User(String userName) {
//		this.userName = userName;
//	}

	//3. ${} 占位符  读取配置
	@Value("${kzx.hometown}")
	public String homeTown;

}
